using System.Collections.Generic;
using Godot;

namespace Arcane.Source.Client.Extensions;

public static class NodeExt
{
    public static void QueueFreeChildren<T>(this T node) where T : Node
    {
        foreach (var child in node.GetChildren())
        {
            child.QueueFree();
        }
    }

    public static void RemoveChildren<T>(this T node) where T : Node
    {
        foreach (var child in node.GetChildren())
        {
            node.RemoveChild(child);
        }
    }
}